package saas.dev.cloud;

/**
 * @author : y1
 * @className : AppErrorDefinitionException
 * @date: 2023/2/3 12:45
 * @description :
 */
public class AppErrorDefinitionException extends RuntimeException{
    private final Integer code;
    private final String msg;
    private final String stackMessage;

    public AppErrorDefinitionException(AppErrorDefinition appError) {
        this(appError.getCode(), appError.getMsg(), (String)null, (Throwable)null);
    }

    public AppErrorDefinitionException(Integer code, String msg) {
        this(code, msg, (String)null, (Throwable)null);
    }

    public AppErrorDefinitionException(Integer code, String msg, String stackMsg) {
        this(code, msg, stackMsg, (Throwable)null);
    }

    public AppErrorDefinitionException(Integer code, String msg, String stackMsg, Throwable throwable) {
        super("" + code + ":" + msg);
        this.code = code;
        this.msg = msg;
        this.stackMessage = stackMsg;
    }

    public Integer getCode() {
        return this.code;
    }

    public String getMsg() {
        return this.msg;
    }

    public String getStackMessage() {
        return this.stackMessage;
    }
}
